package org.zjt.platform.springbootreactivedemo.controller;

import org.zjt.platform.springbootreactivedemo.entity.Person;
import org.zjt.platform.springbootreactivedemo.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @author <a href="juntao.zhang@qq.com">juntao.zhang</a>
 * @Description:
 * @Package org.zjt.platform.springbootreactivedemo
 * @date 2018/3/15 15:04
 * @see
 */
@RestController
public class HelloController {

    @Autowired
    private PersonService personService;


    @GetMapping(value = "/persons",produces={MediaType.APPLICATION_XML_VALUE})
    public Flux<Person> hi() {
        return personService.getAllPerson();
    }
}
